﻿CREATE PROCEDURE [dbo].[ListAllProjects]
@StatusID INT=NULL
AS
SELECT ProjectID, 
		Name as ProjectName, 
		Description, 
		ManagerUserID, 
		EstCompletionDate, 
		EstDuration,
		COALESCE(ProjectTypeID, 1) AS ProjectTypeID,
		COALESCE(StatusID, 1) AS StatusID,
		COALESCE(BilledAsOf, '1/1/2000') AS BilledAsOf
	FROM Projects
	WHERE StatusID = COALESCE(@StatusID, StatusID)
	ORDER BY Name


